Skip to content

Conversation

leonschoorl
Copy link
Member

This fixes the exact problem encountered in #2815.

But there are still other places in the evaluator that still need some more work:

  • [quot,rem][Int,Word][8,16,32,64]#: when presented with 0 divisors these don't throw normal Haskell exception, but some lower level exception that just kills the haskell process.
    So we should just check that the divisor isn't zero instead of trying to catch exceptions, possibly for all of them.
    Also this needs a some refactoring as we currently don't have direct access to the arguments, because how the evaluation is defined via the lift* functions.
  • quoteRem*: these all output tuples with two numbers, some of them make calls to catchDivByZero, but per output number.
    This isn't correct, because when catchDivByZero catches a division by zero, it'll put in an undefined with the type of the full result.
    So you and up with something like quotRemInt 3 0 evaluating to:
    ( undefined :: (Int,Int), undefined :: (Int,Int) ) :: (Int,Int)

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant